package com.itcat.autoconfig;

import com.itcat.autoconfig.properties.AppProperties;
import com.itcat.autoconfig.properties.JwtProperties;
import com.itcat.autoconfig.properties.OssProperties;
import com.itcat.autoconfig.template.AppTemplate;
import com.itcat.autoconfig.template.OssTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * [配置类]
 *
 * @author : [Cr Mr]
 * @version : [v1.0]
 * @date : [2022/3/30 12:38]
 */
@EnableConfigurationProperties({
        AppProperties.class,
        JwtProperties.class,
        OssProperties.class,
})
public class MallAutoConfiguration {

    @Bean
    public AppTemplate appTemplate(AppProperties appProperties) {
        return new AppTemplate(appProperties);
    }

    @Bean
    public JwtProperties jwtProperties(JwtProperties jwtProperties) {
        return jwtProperties;
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties properties) {
        return new OssTemplate(properties);
    }

}
